﻿/*****************************************************************//**
 * @file    FITKGraphObjectPredefinedFieldTemperature.h
 * @brief   Graph object base for temperature predefined field.
 *
 * @author  ChengHaotian (yeguangbaozi@foxmail.com)
 * @date    2024-07-04
 *********************************************************************/

#ifndef __FITKGRAPHOBJECTPREDEFINEDFIELDTEMPERATURE_H__
#define __FITKGRAPHOBJECTPREDEFINEDFIELDTEMPERATURE_H__

#include "FITKGraphObjectPredefinedFieldBase.h"

#include "FITKVTKGraphAdaptorAPI.h"

 // Forward declaration
class vtkPointSource;
class vtkDoubleArray;

class FITKGraphActor;
class FITKPolygonSource;

namespace Interface
{
    class FITKAbaPredefinedFieldTemperature;
}

namespace Exchange
{
    /**
     * @brief   Graph object base for temperature predefined field.
     * @author  ChengHaotian (yeguangbaozi@foxmail.com)
     * @date    2024-07-04
     */
    class FITKVTKGRAPHADAPTORAPI FITKGraphObjectPredefinedFieldTemperature : public FITKGraphObjectPredefinedFieldBase
    {
        // Regist
        FITKGraphObjectRegist(FITKGraphObjectPredefinedFieldTemperature, FITKGraphObjectPredefinedFieldBase);
        FITKCLASS(Exchange, FITKGraphObjectPredefinedFieldTemperature);

    public:
        /**
         * @brief   Constructor.
         * @param   caseData: The case data
         * @param   fieldData: The predefined field data object
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-07-04
         */
        FITKGraphObjectPredefinedFieldTemperature(AbaqusData::FITKDataCase* caseData, Interface::FITKAbaPredefinedFieldTemperature* fieldData);

        /**
         * @brief   Destructor.[virtual]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-07-04
         */
        virtual ~FITKGraphObjectPredefinedFieldTemperature();

        /**
         * @brief   Highlight the predefined field graph actors.[virtual][override]
         * @param   color: The given color for highlighting this time[default]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-07-04
         */
        virtual void highlight(QColor color = QColor()) override;

        /**
         * @brief   Dis-highlight the predefined field graph actors.[virtual][override]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-07-04
         */
        virtual void disHighlight() override;

        /**
         * @brief   Set the render, which will add this graph object to itself.( for calculating size )[override]
         * @param   render: The FITKGrapgRender
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-07-04
         */
        void setFITKRender(Comp::FITKGraphRender* render) override;

        /**
         * @brief   Update the actor with the camera normal.[override]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-07-04
         */
        void updateCameraNormal() override;

    private:
        /**
         * @brief   Initialize.[override]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-07-04
         */
        void init() override;

        /**
         * @brief   Initialize the actors.[override]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-07-04
         */
        void initActors() override;

        /**
         * @brief   Generate the grid data for the predefined field.[override]
         * @param   fieldData: The predefined field data object
         * @return  Is OK
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-07-04
         */
        bool generatePolyData(Interface::FITKAbaAbstractPredefinedField* fieldData) override;

        /**
         * @brief   Generate predefined field actor.[override]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-07-04
         */
        void generateGraph() override;

    private:
//#ifdef QT_NO_DEBUG
        /**
         * @brief   The input source of glyph 3d.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-07-04
         */
        FITKPolygonSource* m_polygonSource{ nullptr };
//#else
        /**
         * @brief   The input source of glyph 3d for debug.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-07-04
         */
        vtkPointSource* m_pointSource{ nullptr };
//#endif

    };
}   // namespace Exchange

#endif // __FITKGRAPHOBJECTPREDEFINEDFIELDTEMPERATURE_H__
